import { request } from '@vipl520/utils'
import type { LoginData } from '@/api/default/user/types'

/**
 * 用户
 */
// 用户登录
export function loginApi(data: LoginData) {
  return request({
    url: '/adminapi/user/login',
    method: 'post',
    data
  })
}

// 获取用户信息
export function getInfoApi(token: string) {
  return request({
    url: '/adminapi/user/info',
    method: 'post',
    data: { token }
  })
}

// 退出登录
export function logoutApi() {
  return request({
    url: '/adminapi/user/logout',
    method: 'post'
  })
}
